package Computer.Main;
import java.util.ArrayList;
import Computer.Event.Instruction;

public abstract class Program {

	private ArrayList<Instruction> instructions = new ArrayList<Instruction>();
		
	public void add(Instruction instruction) {
		instructions.add(instruction);
	}
	
	public Instruction get(int index) {
		return instructions.get(index);
	}
	
	public String toString() {
		
		StringBuilder result = new StringBuilder();
		
		int counter = 0;

		for(Instruction i : instructions) {
			result.append(counter++);
			result.append(" " + i.toString() + "\n");
		}
			
		return result.toString();
	}	
}
